
const app = getApp()
Page({
  data: {
    pageNum:1,
    pageTotal:0,
    discount_list:[],
    active:0
  },
  onLoad: function (options) {
    this.getDistcountList()
  },
  getDistcountList(){
    let _this = this
    app.util.request({
      url: 'api/acquisition/findLimit',
      method: "post",
      data: {
        state:_this.data.active,
        page:_this.data.pageNum,
        pageSize:10
      },
      success(response) {
          if (response.data.code == 0) {
            _this.setData({
              pageTotal:response.data.data.pages,
              discount_list:[..._this.data.discount_list,...response.data.data.list]
            })
          }
      }
    })
  },
  onChange(event){
    this.setData({
      active:event.detail.index,
      discount_list:[],
      pageNum:1
    })
    this.getDistcountList()
  }
})